<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML >
<html>
	<head>
		<title></title>
		<script type="text/javascript" src="../resources/js/jquery.min.js"></script>
		<script type="text/javascript" src="../resources/js/operamasks-ui.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../resources/css/apusic/om-apusic.css" />
		<!--<link rel="stylesheet" type="text/css" href="../resources/css/default/om-default.css" />-->
    	<style>
    		html, body{ width: 100%; height: 100%; padding: 0; margin: 0;}
    			#center-tab .om-panel-body{
    			padding: 0;
    		}
    	</style>
		<script type="text/javascript" language="javascript"> 
		function SetCwinHeight(o){
			if (document.getElementById){
			   if (o && !window.opera){
			    if (o.contentDocument && o.contentDocument.body.offsetHeight){
			     o.height =  $('#center-panel').height() - $('#center-panel').find(".om-tabs-headers").outerHeight() - 10;
			    }else if(o.Document && o.Document.body.scrollHeight){
			     o.height = $('#center-panel').height() - $('#center-panel').find(".om-tabs-headers").outerHeight() - 10;
			    }
			   }
			}
			}
		function getHeight(){
			var h = $('#west-panel').height()-60;
			return h;
		}
		</script>
		<script type="text/javascript">
			$(document).ready(function() {
				 var element = $('body').omBorderLayout({
		           	   panels:[{
		           	        id:"north-panel",
		           	        region:"north",
		           	        resizable:true,
		           	     	header:false,
		           	        collapsible:true,
		           	     	closable: false
		           	    },{
		           	        id:"center-panel",
		           	     	header:false,
		           	        region:"center"
		           	    },{
		           	        id:"west-panel",
		           	        resizable:true,
		           	        collapsible:true,
		           	    	title:"导航",
		           	        region:"west",
		           	        width:250
		           	    }],
		           	    spacing:1
		            });
				 var tabElement = $('#center-tab').omTabs({
		                height :'fit'
		         });
		        /* 
    			$('#combo').omCombo({
        			dataSource:'comboData.action',
        			optionField:function(data,index){
    					return '<font color="red">'+'编号:'+index+'：</font>'+data.TSmName+'(ID:'+data.TSmCode+')';
        			},
        			inputField : function(data, index) {
                        return data.TSmName;
                    },
        			valueField:'TSmCode',
        			emptyText:'select one option!',
        		    value:'00',
        		    editable:false,
        		    lazyLoad:true,
        		    listMaxHeight:220,
        		    listAutoWidth:true
        		        			
    			});
    			*/
    			$("#mytree1").omTree({
                    dataSource:'../sysMenu/getSysMenu.action',
                    simpleDataModel: true,
                    onClick: function(nodeData,event) {
    					if(nodeData.url){
    						var tabId = tabElement.omTabs('getAlter', 'tab_'+nodeData.id);
    						if(tabId){
    							tabElement.omTabs('activate', tabId);
            				}else{
            					tabElement.omTabs('add',{
            						 title : nodeData.text,
            						 tabId : 'tab_'+nodeData.id,
            						 content : "<iframe id='"+nodeData.id+"' border=0 frameBorder='no'"+
            						 " name='inner-frame' src='.."+nodeData.url+"'"+
            						 " height='"+($('#center-panel').height() - $('#center-panel').find(".om-tabs-headers").outerHeight() - 10)+"' width='100%'></iframe>",
            						 closable : true
                				})
                			}
        				}
					} 
                });
    			 	 
			});

	</script>
	</head>
	
	<body>
		<div id="north-panel" >
			<table id='headlogobg' border="0" cellpadding="0" height="60" cellspacing="0" width="100%" background="../resources/images/headbg.gif" >
				<tr>
					<td>
						<img alt="" src="../resources/images/logo.gif">
					</td>
				</tr>
			</table>
		</div>
		<div id="center-panel">
		 	<div id="center-tab" >
				<ul>
		           <li><a href="#tab1">首页</a></li>
		        </ul>
		        <div id="tab1" >
		           <iframe id='baidu' onLoad="Javascript:SetCwinHeight(this)" src='welcome.jsp' width='99%'></iframe>
		        </div>
			</div>
    	</div>
    	
    	<div id="west-panel">
    	    <ul id="mytree1"></ul>
    	</div>
    	
	</body>
</html>
